#ifndef _IMAGE_H_
# define _IMAGE_H_

# include <SDL/SDL.h>

struct Image
{
public:
	SDL_Surface* Surface;
	SDL_Rect Position;

	Image()
	: Surface(NULL)
	{
		Position.x = 0;
		Position.y = 0;
		Position.w = -1;
		Position.h = -1;
	}

	Image(SDL_Rect& _position)
	: Surface(NULL), Position(_position)
	{
		Position.w = -1;
		Position.h = -1;
	}

	Image(Sint16 _x, Sint16 _y)
	: Surface(NULL)
	{
		Position.x = _x;
		Position.y = _y;
		Position.w = -1;
		Position.h = -1;
	}

	bool setTransparence(Uint32 _color = 0xFF00FF)
	{
		if (Surface != NULL)
		{
			if (SDL_SetColorKey(Surface, SDL_RLEACCEL | SDL_SRCCOLORKEY, _color) == -1)
				return (false);
			return (true);
		}
		return (false);
	}

	~Image()
	{
		if (Surface != NULL)
			SDL_FreeSurface(Surface);
	}
};

#endif // _IMAGE_H_